import {View, ScrollView, Text, Image, Button} from '@tarojs/components';
import Taro from '@tarojs/taro';
import React from 'react';
import {connect} from 'react-redux';
import * as T from './types';
import './index.less';
import actions from './actions';
import {store2Props} from './selectors';
import testImg from '@/assets/image/ipland/test.png';
import searchIcom from '@/assets/image/ipland/searchIcom.png';
import notdata from '@/assets/image/ipland/notdata.png';

//@ts-ignore
actions().actions.loadReducer();
//@ts-ignore
@connect<Partial<T.IProps>, any>(store2Props, actions)
export default class packageIHistory extends React.Component<Partial<T.IProps>, any> {
  constructor(props) {
    super(props);
    this.state = {
      list: [],
    };
  }

  componentDidMount() {}

  componentWillUnmount() {
    this.props.actions.clean();
  }

  componentWillMount(): void {
    this.props.actions.init();
  }

  componentDidShow() {}

  render() {
    let {list} = this.state;
    return (
      <View className="packageIHistory">
        <ScrollView scrollY>
          {list ? (
            <View>
              <Image className="searchIcom" src={searchIcom} mode="widthFix" />
              <View className="wishPoolBox">
                <Text className="title">今天</Text>
                <View className="wishBox">
                  {/* <View className="wishBox-item">
                  <Image className="wishBox-item-img" src={testImg} mode="aspectFill" />
                  <View className="wishBox-item-con removedBox">
                    <Image className="removedIcon" src={icon2} mode='heightFix' />
                    <View className="wishBox-item-con-getBox">
                      <Text>查看相似</Text>

                    </View>
                  </View>
                </View> */}
                  <View className="wishBox-item">
                    <Image className="wishBox-item-img" src={testImg} mode="aspectFill" />
                    <View className="wishBox-item-con">
                      {/* <Text className="wishBox-item-con-name">云朵软绵绵</Text> */}
                      <View className="wishBox-item-con-getBox">
                        <Text>¥6666</Text>
                      </View>
                    </View>
                  </View>
                  <View className="wishBox-item">
                    <Image className="wishBox-item-img" src={testImg} mode="aspectFill" />
                    <View className="wishBox-item-con">
                      <View className="wishBox-item-con-getBox">
                        <Text>¥6666</Text>
                      </View>
                    </View>
                  </View>
                  <View className="wishBox-item">
                    <Image className="wishBox-item-img" src={testImg} mode="aspectFill" />
                    <View className="wishBox-item-con">
                      {/* <Text className="wishBox-item-con-name">云朵软绵绵</Text> */}
                      <View className="wishBox-item-con-getBox">
                        <Text>¥6666</Text>
                      </View>
                    </View>
                  </View>
                  <View className="wishBox-item">
                    <Image className="wishBox-item-img" src={testImg} mode="aspectFill" />
                    <View className="wishBox-item-con">
                      {/* <Text className="wishBox-item-con-name">云朵软绵绵</Text> */}
                      <View className="wishBox-item-con-getBox">
                        <Text>¥6666</Text>
                      </View>
                    </View>
                  </View>
                  <View className="wishBox-item">
                    <Image className="wishBox-item-img" src={testImg} mode="aspectFill" />
                    <View className="wishBox-item-con">
                      {/* <Text className="wishBox-item-con-name">云朵软绵绵</Text> */}
                      <View className="wishBox-item-con-getBox">
                        <Text>¥6666</Text>
                      </View>
                    </View>
                  </View>
                  <View className="wishBox-item">
                    <Image className="wishBox-item-img" src={testImg} mode="aspectFill" />
                    <View className="wishBox-item-con">
                      {/* <Text className="wishBox-item-con-name">云朵软绵绵</Text> */}
                      <View className="wishBox-item-con-getBox">
                        <Text>¥6666</Text>
                      </View>
                    </View>
                  </View>
                  <View className="wishBox-item">
                    <Image className="wishBox-item-img" src={testImg} mode="aspectFill" />
                    <View className="wishBox-item-con">
                      {/* <Text className="wishBox-item-con-name">云朵软绵绵</Text> */}
                      <View className="wishBox-item-con-getBox">
                        <Text>¥6666</Text>
                      </View>
                    </View>
                  </View>
                </View>
              </View>
              <View className="wishPoolBox">
                <Text className="title">昨天</Text>
                <View className="wishBox">
                  {/* <View className="wishBox-item">
                  <Image className="wishBox-item-img" src={testImg} mode="aspectFill" />
                  <View className="wishBox-item-con removedBox">
                    <Image className="removedIcon" src={icon2} mode='heightFix' />
                    <View className="wishBox-item-con-getBox">
                      <Text>查看相似</Text>

                    </View>
                  </View>
                </View> */}
                  <View className="wishBox-item">
                    <Image className="wishBox-item-img" src={testImg} mode="aspectFill" />
                    <View className="wishBox-item-con">
                      {/* <Text className="wishBox-item-con-name">云朵软绵绵</Text> */}
                      <View className="wishBox-item-con-getBox">
                        <Text>¥6666</Text>
                      </View>
                    </View>
                  </View>
                  <View className="wishBox-item">
                    <Image className="wishBox-item-img" src={testImg} mode="aspectFill" />
                    <View className="wishBox-item-con">
                      <View className="wishBox-item-con-getBox">
                        <Text>¥6666</Text>
                      </View>
                    </View>
                  </View>
                  <View className="wishBox-item">
                    <Image className="wishBox-item-img" src={testImg} mode="aspectFill" />
                    <View className="wishBox-item-con">
                      {/* <Text className="wishBox-item-con-name">云朵软绵绵</Text> */}
                      <View className="wishBox-item-con-getBox">
                        <Text>¥6666</Text>
                      </View>
                    </View>
                  </View>
                  <View className="wishBox-item">
                    <Image className="wishBox-item-img" src={testImg} mode="aspectFill" />
                    <View className="wishBox-item-con">
                      {/* <Text className="wishBox-item-con-name">云朵软绵绵</Text> */}
                      <View className="wishBox-item-con-getBox">
                        <Text>¥6666</Text>
                      </View>
                    </View>
                  </View>
                  <View className="wishBox-item">
                    <Image className="wishBox-item-img" src={testImg} mode="aspectFill" />
                    <View className="wishBox-item-con">
                      {/* <Text className="wishBox-item-con-name">云朵软绵绵</Text> */}
                      <View className="wishBox-item-con-getBox">
                        <Text>¥6666</Text>
                      </View>
                    </View>
                  </View>
                  <View className="wishBox-item">
                    <Image className="wishBox-item-img" src={testImg} mode="aspectFill" />
                    <View className="wishBox-item-con">
                      {/* <Text className="wishBox-item-con-name">云朵软绵绵</Text> */}
                      <View className="wishBox-item-con-getBox">
                        <Text>¥6666</Text>
                      </View>
                    </View>
                  </View>
                  <View className="wishBox-item">
                    <Image className="wishBox-item-img" src={testImg} mode="aspectFill" />
                    <View className="wishBox-item-con">
                      {/* <Text className="wishBox-item-con-name">云朵软绵绵</Text> */}
                      <View className="wishBox-item-con-getBox">
                        <Text>¥6666</Text>
                      </View>
                    </View>
                  </View>
                </View>
              </View>
              <Text className="tip">小主，只能查看100条记录哦～</Text>
            </View>
          ) : (
            <View className="notdataBox">
              <View className="notdataCon">
                <Image className="notdatabg" src={notdata} mode="widthFix" />
                <Text className="notdataText">什么也没有 好多宝贝等你发现</Text>
                <Text
                  className="notdataToSearch"
                  onClick={() => {
                    Taro.showToast({
                      title: 't跳转ipshop首页',
                    });
                  }}
                >{`去发现 >>`}</Text>
              </View>
            </View>
          )}
        </ScrollView>
      </View>
    );
  }
}

//create by moon https://github.com/creasy2010/moon
